package com.mdlib.helper.ui.widget;

import android.content.Context;
import android.support.v4.app.FragmentTabHost;
import android.util.AttributeSet;

/**
 * Created by librabin on 16/10/12.
 */

public class MDFragmentTabHost extends FragmentTabHost {

    private String mCurrentTab;

    private String mNoTabChangedTab;

    public MDFragmentTabHost(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public void onTabChanged(String tabId) {
        if (tabId.equals(mNoTabChangedTab)) {
            setCurrentTabByTag(mCurrentTab);
        } else {
            super.onTabChanged(tabId);
            mCurrentTab = tabId;
        }
    }

    public void setNoTabChangedTag(String tabId) {
        mNoTabChangedTab = tabId;
    }
}
